<template>
    <div class="contentDiv">
        <Spin size="large" fix v-if="Loading"></Spin>
        <Form :label-width="10">
            <div style="color:red">
                <Row>
                    <i-col span="24" class="title">
                        <Form-item :label-width="10">
                            换证打印说明
                        </Form-item>
                    </i-col>
                </Row>
                <Row>
                    <Form-item>
                        如果低保边缘家庭经过变更、迁移等业务办理有证面信息发生变化时，需要点击【换证打印】加载最新证件数据信息，包括页码2、3、4页内容。
                    </Form-item>
                </Row>
            </div>
            <Row>
                <i-col span="24" class="title">
                    <Form-item :label-width="10">
                        打印操作
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="24" class="title">
                    <Form-item :label-width="1">
                        <Button type="primary" icon="ios-redo" @click="clickCertificate">换证打印
                        </Button>
                    </Form-item>
                </i-col>
            </Row>
        </Form>

    </div>
</template>

<script>
    import {postAction} from '@/api/request'
    import ICol from "view-design/src/components/grid/col";
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import {LodopMixin} from '../lodop'

    export default {
        mixins: [CommonMixin, LodopMixin],
        components: {ICol},
        props: ['dczb0001'],
        data() {
            return {
                modal1: false,
                visible: false,
                disableSubmit: false,
                title: "",
                model: {},
                canPrint: false,
                beforeMonths: "0",
                url: "/api/ac/subsistence/lodopFamilyServiceImpl/updateCertificate",
            }
        },
        methods: {
            clickCertificate() {
                this.$Modal.confirm({
                    title: '确定换证打印吗？',
                    onOk: () => {
                        this.updateCertificate();
                    }
                })
            },
            updateCertificate() {
                this.Loading = true;
                var param = new Object();
                param.dczb0001 = this.dczb0001;
                postAction(this.url, param).then((res) => {
                    if (res.data.errcode != 0) {
                        this.$Message.error(res.data.errmsg);
                    } else {
                        this.$Message.success("换证成功！");
                        this.$emit('finishCertificate');
                    }
                }).finally(() => {
                    this.Loading = false;
                })
            }
        },
        mounted() {

        }
    }
</script>

<style scoped>
    /deep/ .title {
        height: 50px;
        text-align: center;
        line-height: 50px;
    }
</style>